-
-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the gcc spkg to version 14.2.0 using iains/gcc-14-branch #38905
Conversation
Documentation preview for this PR (built with commit edd5553; changes) is ready! 🎉 |
I have an Apple silicon machine with a lot of |
I have never tried building Sage with What sort of error messages are you getting? Are you seeing this? I wonder if givaro and ppl publish requirements for the gcc version. |
I'm not sure if Sage has ever built on OS X (in recent memory) with
and for givaro
|
That seems to be the same error in both cases and it seems to arise in C++ print statements. I am trying a build with those options on Intel. It takes a really long time to build gcc, which has to happen before almost anything else. It has to build the compiler 3 times and verify that building the third compiler with the second compiler produces an identical copy of the second compiler. Then it starts all over and builds gmp, mpfr and mpc with the new gcc. It is hard to imagine why anyone would ever want to do that as part of building sage. Building the gfortran spkg is trivial by comparison. It wouldn't surprise me to learn that the previous update to the gfortran package was not tested in this way, even though it modified the gcc spkg, but who knows? |
Well, on Intel I got two errors. The first is probably a genuine bug in this version of the gfortran spkg. EDIT: This is not a bug in the gfortran package, but a "feature" of Sage's configure script. One is expected to know to disable the gfortran package when the gcc package is enabled. This does not happen automatically. The error message says:
The second error occurs in the ecm spkg. Apparently some of the assembly language files in that package are not compatible with gcc 14 for Intel. The error is:
The file mulredc1.s is created by
|
Probably the right solution (not for this PR) is to disable, or at least provide strong warnings against, the option |
That sounds reasonable, but I don't know how to do it. Regarding the ecm error, the problematic lines in the file mulredc1.s look like this: |
I found the explanation for the ecm issue here. The Looking at build/ecm-7.0.6/src/x86_64/Makefile.in reveals that this is an upstream bug. The Makefile.in says:
The claim that "Nothing here needs the C preprocessor" is patently false, since mulredc1.asm and most of the other assembler files contain if defined() directives. I was able to come up with a patch to fix this. It replaces .s by .sx throughout the Makefile.in. So I am now continuing my Intel build (with --disable-gfortran added as a configuration option). edit: givaro built without issues on Intel |
…nsion for assembler files.
For the record, I also ran into issues with Flint when building with Sage's gcc on my arm system. I think it is true that the arm version of gcc built by this PR is not ready for prime time, but neither was the one which is replaces. There is a reason that the gcc project does not officially support Apple silicon yet. And there seems to be no problem with the gfortran, which is the main focus of github/iains |
The various linux "minimal" buildbots are failing to build |
It looks to me like the failure is caused by not having flex installed. Is there a way to check which packages are installed in those containers? |
I am very far from an expert in this, but maybe it's the file |
The tox.ini file contains this line: The flex requirement is documented here: https://gcc.gnu.org/install/prerequisites.html. Looking at the gcc build logs, it appears that some attempt is made to deal with flex being missing but it does not succeed in this case. |
Well, I have no idea how to make sure that flex is installed in the "minimal" docker images, nor what that has to do with tox, nor why the current spkg builds without flex (given that gcc says it is required). I can say that this gfortran spkg builds on my ubuntu-24.04 system, which does have flex, and appears to work -- i.e. the openblas spkg builds. |
I think I may have figured out how to get flex installed in the docker images: by editing files in build/_prereq/distros. I tried adding it in debian.txt. We will see what the CI runner does. |
@jhpalmieri: While some of those CI jobs are still failing, the failures are not happening in the gfortran-14.2 build, as far as I can tell. Some of the failed jobs are using the system gfortran 13, but the ones which do build gfortran 14 seem to do so without errors. So I think that adding flex as a prerequisite fixed this issue. |
Okay, let's merge it! |
Thanks, John! |
The ecm patch seems to be causing trouble for some X86_64 macOS machines, see |
I think we should just get rid of gcc package (perhaps, leave gfortran). As proposed in #32532 |
I don't see why |
@jhpalmieri - did you test the branch on an Intel mac? |
The ECM patch added in sagemath#38905 breaks some macOS installations. As it was added in order to support building ECM with gcc 14, which is a rather hypothetical situation, it's OK to drop it. This will fix sagemath#39039 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39040 Reported by: Dima Pasechnik Reviewer(s): Kwankyu Lee
This PR updates the gcc spkg (and hence the gfortran spkg) to version 14.2.0. I tested that the spkg builds cleanly on macOS 15.1 (Sequoia) using XCode 16.1 with both Intel and M1 CPUs. I also tested that it builds cleanly on Ubuntu 22.04 using the system gmp and gcc. The openblas spkg also builds on all three of those systems, although I could not determine whether Sage was using the system gfortran or its own gfortran for building openblas on Ubuntu.
There is a caveat. The gcc project does not currently have official support for Apple Silicon. However, the gcc maintainer for darwin, Iain Sandoe , maintains a github site containing gcc source code with "experimental" support for Apple silicon, in addition to Intel. This PR uses the gcc-14-branch repository from that site. The spkg fetches the tag gcc-14.2-darwin-r2 as a tarball and names the tarball as gfortran-14.2.0.tar.gz. The github api does not support publishing hashes of tag downloads. So I downloaded the tag tarball twice and verified that the files were the same for both downloads. I used hashes of that file in checksums.ini.
No patches are needed for building on macOS with either CPU or on Ubuntu. (cf PR #38855)
📝 Checklist
⌛ Dependencies